package com.aya.aop.asp.impl;

import com.aya.aop.asp.AopAnnotation;
import com.aya.aop.asp.InterfaceBean;
import org.springframework.aop.framework.AopContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service
public class InterfaceImplBean implements InterfaceBean {

    @Override
    @AopAnnotation
    public void joke() {
        System.out.println("讲笑话");
    }

    public String targetAdvice() {
        InterfaceImplBean interfaceImplBean = (InterfaceImplBean)AopContext.currentProxy();
        interfaceImplBean.joke();
        System.out.println("return str");
        return "result";
    }
}
